#include "EntityExplosion.h"

CEntityExplosion::CEntityExplosion(int currentPosX, int currentPosY, int indexAnimation, int offsetSpawnX, 
								   int offsetSpawnY, bool active):
				indexAnimation(indexAnimation),currentFrameAnimation(-1), timeLastFrame(-1),
				offsetSpawnX(offsetSpawnX), offsetSpawnY(offsetSpawnY)
{
	assert(indexAnimation>=0);

	this->currentPosX=currentPosX;
	this->currentPosY=currentPosY;
	this->active=active;

	this->collisionCost=0;
	this->collisionRectangle=CRectangle(0,0,0,0);
	this->currentHealth=0;
	this->indexFrame=0;
	this->indexSprite=0;
	this->previousPosX=0;
	this->previousPosY=0;
	this->side=eSideNeutral;
	this->speed=0;
}
CEntityExplosion::CEntityExplosion(void){}
CEntityExplosion::~CEntityExplosion(void){}

void CEntityExplosion::update(void){}
void CEntityExplosion::render(void)
{
	if(VIS.displayAnimation(this->indexAnimation,this->currentPosX+this->offsetSpawnX,this->currentPosY+this->offsetSpawnY, &this->currentFrameAnimation, &this->timeLastFrame,true))
	{
		die();
	}
}

int CEntityExplosion::getIndexAnimation(void)const
{
	return this->indexAnimation;
}
int CEntityExplosion::getCurrentFrameAnimation(void)const
{
	return this->currentFrameAnimation;
}
int CEntityExplosion::getTimeLastFrame(void)const
{
	return this->timeLastFrame;
}
int CEntityExplosion::getOffsetSpawnX(void)const
{
	return this->offsetSpawnX;
}
int CEntityExplosion::getOffsetSpawnY(void)const
{
	return this->offsetSpawnY;
}
void CEntityExplosion::setIndexAnimation(int indexAnimation)
{
	this->indexAnimation=indexAnimation;
}
void CEntityExplosion::setCurrentFrameAnimation(int currentFrameAnimation)
{
	this->currentFrameAnimation=currentFrameAnimation;
}
void CEntityExplosion::setTimeLastFrame(int timeLastFrame)
{
	this->timeLastFrame=timeLastFrame;
}
void CEntityExplosion::setOffsetSpwanX(int offsetSpawnX)
{
	this->offsetSpawnX=offsetSpawnX;
}
void CEntityExplosion::setOffsetSpwanY(int offsetSpawnY)
{
	this->offsetSpawnY=offsetSpawnY;
}